<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            cursor: none;
        }
        
        body {
            position: relative;
            width: 100vw;
            height: 100vh;
            padding-top: calc(50vh - 40px)/*40px为div.app盒子的高度的一半*/
        }
        
        .app {
            text-align: center;
            text-transform: capitalize;
            width: 500px;
            margin: 0 auto;
            font-size: 30px;
            text-shadow: 10px 10px 6px #777;
        }
        
        img {
            position: absolute;
            animation: rotate 2s linear infinite;
        }
        
        @keyframes rotate {
            0% {
                transform: rotate(0deg);
            }
            50% {
                transform: rotate(180deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
    </style>
</head>

<body>
    <img src="./logo192.png" alt="">
    <div class="app">
        I decided who i wanted to be, <br> and that is who i am
    </div>
</body>
<script>
    let app = document.querySelector('.app')
    let img = document.querySelector('img')
    window.onmousemove = (e) => {
        let w = window.innerWidth / 2
        let h = window.innerHeight / 2
            //96是图片宽高度的一半
        img.style.top = `${e.clientY-96}px`
        img.style.left = `${e.clientX-96}px`
        app.style.textShadow = `
            ${-(e.clientX-w)/10}px ${-(e.clientY-h)/10}px 5px #888
        `
    }
</script>

</html>